<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var obj = {};
        Object.defineProperty(obj,"name",{
            value:"laowang",
            writable:true,
            enumerable:true,
            configurable:true
        });
        console.log(obj);
        var obj2 = {};
        Object.defineProperties(obj2,{
            name:{
                value:"xiaozhang",
                writable:false,
                enumerable:false,
                configurable:false
            },
            age:{
                value:19,
                writable:true,
                enumerable:false,
                configurable:false
            },
            eat:{
                value:function(){
                    console.log("hello");
                },
                writable:true,
                enumerable:false,
                configurable:false
            }
        });
        console.log(obj2);
    </script>
</body>
</html>